From d852b29999844ea610ecc24c8e8a7086ff18ec9c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 23 Sep 2002 00:20:15 +0000 Subject: [PATCH] (select-safe-coding-system): Cope if default-coding-system gives nil which was then used in `min'. --- lisp/international/mule-cmds.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 4eaf6184a91..1f657700fc8 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -723,9 +723,10 @@ and TO is ignored." (let ((window-configuration (current-window-configuration))) (save-excursion ;; Make sure the offending buffer is displayed. - (when (and default-coding-system (not (stringp from))) + (when (and (consp default-coding-system) (not (stringp from))) (pop-to-buffer bufname) - (goto-char (apply 'min (mapcar #'(lambda (x) (car (cadr x))) + ;; The `or' is because sometimes (car (cadr x)) is nil. + (goto-char (apply 'min (mapcar #'(lambda (x) (or (car (cadr x)) (point-max))) default-coding-system)))) ;; Then ask users to select one from CODINGS. (with-output-to-temp-buffer "*Warning*" -- 2.30.2